///////////////////////////////////////////////////////////////////////////////
//
//  Copyright (C) 2007-2009 ILOG, S.A.
//  All Rights Reserved.
//  The following is ILOG Source Code.  No modifications may be made to the  
//  ILOG Source Code.  Any usage of the ILOG Source Code is subject to 
//  the terms and conditions of the ILOG End User License Agreement   
//  applicable to this ILOG software product.
//
///////////////////////////////////////////////////////////////////////////////

package ilog.gauges
{
  import flash.events.EventDispatcher;
  
  import ilog.gauges.gaugesClasses.IScale;

  /**
   * A <code>TickItem</code> represents a single tick in a scale. 
   * Since scale objects are shared between circular and rectangular
   * gauges, <code>TickItem</code> is used in both types of gauges.
   * It serves as data for <code>RectangleTickRenderer</code> and
   * <code>CircleTickRenderer</code> which implement <code>IDataRenderer</code>.
   * 
   * @see ilog.gauges.RectangleTickRenderer
   */
  public class TickItem extends EventDispatcher
  {
    /**
     * Constructor.  
     * @param scale The scale this item pertains to.
     * 
     */    
    public function TickItem(scale:IScale)
    {
      super();
      this.scale = scale;
    }
    
    /**
     * The scale this item pertains to.
     *   
     */     
    public var scale:IScale;    
    
    /**
     * The value the tick item represents.  
     */     
    public var value:Object;
    
    /**
     * Specifies whether the tick is minor or major.   
     */     
    public var isMinor:Boolean;

    /**
     * A number in the [0, 1] interval that represents the relative position of the tick on the scale.
     */     
    public var position:Number;
    
    /**
     * @private
     */     
    override public function toString():String
    {
      return isMinor?"minor":"major" + " tick item" + " value =" + value + 
                     " position =" + position;
    }
  }
}
